﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Weka;
using Test;

namespace Version3
{
    [MessageId(33)]
    class Earth : Header
    {
        [Field(2)]
        public int? DistanceFromSun { get; set; }
        [Field(5)]
        public int Diameter { get; set; }
        [Field(6)]
        public IEnumerable<Country> Countries { get; set; }
        [Field(7)]
        public IEnumerable<Ocean> Oceans { get; set; }
    }

    [MessageId(14)]
    class Country
    {
        [MissingValueSetter]
        private void SetMissingValues(IEnumerable<byte> mvs)
        {
            if (mvs.Any(mfid => mfid == 26))
                Notes = "The notes are missing for " + Name + " (ver 3)";
        }


        [Field(10)]
        public bool? IsDemocracy { get; set; }

        [Field(22)]
        public string Name { get; set; }

        [Field(26)]
        public string Notes { get; set; }

        [Field(23)]
        public int Population { get; set; }

        [Field(24)]
        public Religion PrimaryReligion { get; set; }

        [Field(25)]
        public IEnumerable<Town> Towns { get; set; }

        [Field(27)]
        public DateTime? NationalDay { get; set; }

        [Field(28)]
        public Town Capital { get; set; }
    }

    [MessageId(15)]
    class Town
    {
        [Field(1)]
        public string Name { get; set; }

        [Field(2)]
        public int? Population { get; set; }

        [Field(5)]
        public decimal? Latitude { get; set; }
        [Field(6)]
        public decimal? Longitude { get; set; }
    }

    [MessageId(17)]
    class Ocean
    {
        [Field(3)]
        public string Name { get; set; }
        [Field(7)]
        public int Area { get; set; }
        [Field(8)]
        public int MaxDeapth { get; set; }

        [Field(11)]
        public bool IsPolar { get; set; }
    }

    enum Religion { Islam, Christianity, Buddhism }

}
